﻿using DDD.Core.CQRS;
using DDD.Core.Result;
using DDD.Domain.Entities;
using DDD.Domain.Enums;
using DDD.Domain.ValueObjects;

namespace DDD.Application.Commands.UserCommand.CreateUser
{
    public record CreateUserCommand : ICommand<ApiResult<Guid>, Guid>
    {
        public string UserName { get; init; }

        public string Phone { get; init; }

        public string Email { get; init; }

        public string Password { get; init; }

        public SexEnum Sex { get; init; }

        public Address Address { get; init; }

        public User ToUser()
        {
            return new User().Create(UserName, Phone, Email, Password, Sex, Address);
        }
    }

}
